// import request from './request.js'

const request = {
  get: url => {
    return new Promise((resolve, reject) => {
      uni.request({
        url: `https://files.yzsheng.com${url}?t=${new Date().getTime()}`,
        success: res => {
          resolve(res)
        },
        fail: err => {
          reject(err)
        },
      })
    })
  },
}

// 静态Json数据
const staticDatas = {
  //规格
  specification() {
    return request.get('/json/Bussiness/Brands/specification.json')
  },
  //品牌所有平级
  brandAll() {
    return request.get('/json/Bussiness/Brands/brand.json')
  },
  //品牌所有平级分组
  brandAllGroup() {
    return request.get('/json/Bussiness/Brands/brand_group.json')
  },
  //品牌所有的平级加上下面所有车子的数量
  brandCount() {
    return request.get('/json/Bussiness/Brands/brand_count.json')
  },
  //品牌所有加平级加上下面所有车子的数量分组
  brandCountGroup() {
    return request.get('/json/Bussiness/Brands/brand_count_group.json')
  },
  //品牌系列车子，车子颜色
  brandData() {
    return request.get('/json/Bussiness/Brands/brand_data.json')
  },
  //品牌系列车子，车子颜色——分组
  brandDataGroup() {
    return request.get('/json/Bussiness/Brands/brand_data_group.json')
  },

  //地区
  regionalAll() {
    return request.get('/json/Bussiness/Region/region.json')
  },
  //地区省份
  regionalProvince() {
    return request.get('/json/Bussiness/Region/region_province.json')
  },
  //地区省份分组
  regionalProvinceGroup() {
    return request.get('/json/Bussiness/Region/region_province_group.json')
  },
  //地区市级
  regionalCity() {
    return request.get('/json/Bussiness/Region/region_city.json')
  },
  //地区市级分组
  regionalCityGroup() {
    return request.get('/json/Bussiness/Region/region_city_group.json')
  },
  //地区区县
  regionaldistrict() {
    return request.get('/json/Bussiness/Region/region_district.json')
  },
  //地区区县分组
  regionaldistrictGroup() {
    return request.get('/json/Bussiness/Region/region_district_group.json')
  },
  //分组
  regionalGroup() {
    return request.get('/json/Bussiness/Region/region_group.json')
  },
  //数据源-我们应该用不上
  regionalData() {
    return request.get('/json/Bussiness/Region/region_data.json')
  },
  //地区市级分组经纬度
  regionalCityGroupNew() {
	  return request.get('/json/Bussiness/Region/region_city_group_new.json')
  },

  // 海报数据
  getPosters() {
    return request.get('/json/Bussiness/Other/posters.json')
  },

  // 引导页图片数据
  getGuideImg() {
    return request.get('/json/Bussiness/Other/guide.json')
  },
  //车辆详情
  getCarDetail() {
    return request.get('/json/Bussiness/carDetail/carDetail.json')
  },
  //低首付操作动作
  getLowPayTxt() {
    return request.get('/json/Bussiness/carDetail/lowPayTxt.json')
  },
  //低首付状态
  getLowPaystatus() {
    return request.get('/json/Bussiness/carDetail/lowPayStatus.json')
  },
  //获取快递公司信息
  getexpresscompany() {
    return request.get('/json/Bussiness/Logistics/expresscompany.json')
  },
  //获取车型配置参数
  CarViewParmeterJson(carId) {
    return request.get('/json/Bussiness/CarViewParmeterJson/' + carId + '.json')
  },
  //获取预检外观检查项
  getVisualOutside() {
    return request.get('/json/detection/yujian/detection_appearance.json')
  },
  //获取预检内饰检查项
  getVisualInside() {
    return request.get('/json/detection/yujian/detection_interior.json')
  },
  //获取预检仪表盘检查项
  getVisualMeter() {
    return request.get('/json/detection/yujian/detection_dashboard.json')
  },
  //获取预检其他检查项
  getVisualOther() {
    return request.get('/json/detection/yujian/detection_other.json')
  },
  //获取上检驾驶舱检测项
  getCockpit() {
    return request.get('/json/detection/shangjian/detection_cockpit.json')
  },
  //获取上检发动机检查项
  getEngine() {
    return request.get('/json/detection/shangjian/detection_nacelle.json')
  },
  //获取上检底盘检查项
  getChassis() {
    return request.get('/json/detection/shangjian/detection_chassis.json')
  },

  //获取按保养类型分类商品
  MaintenanceTypeAndGoods() {
    return request.get('/json/client/MaintenanceTypeAndGoods.json')
  },

  //获取全车件列表
  GetCarGoodsTypeAndGoodsList() {
    return request.get('/json/client/GetCarGoodsTypeAndGoodsList.json')
  },

  //隐私协议
  getPrivacyAgreement() {
    return request.get('/bussiness/agreement/privacyAgreement.json')
  },

  //用户协议
  getUuserAgreement() {
    return request.get('/bussiness/agreement/userAgreement.json')
  },
}

export default staticDatas
